This invention relates to an image processing method and apparatus. More particularly, the invention relates to an image processing method and apparatus for entering n-bit multilevel image data and subjecting each pixel of the multilevel image data to processing to convert each pixel to values of two levels or m levels (n&gt;m&gt;2).
A facsimile machine is capable of transmitting the image of a document that has been read by a scanner. The document image is always read at a specific resolution and the read image data is binarized (converted to bi-level image data) without processing being executed in conformity with the purpose of the image data output, i.e. whether the read image data is to be transmitted or merely copied. Similarly, with regard to the number of tones used in error diffusion processing, which is pseudo-halftone processing generally employed in a facsimile machine, 64 tones (expressed by six bits) are invariably employed regardless of whether the image data is transmitted or copied.
Printers such as laser printers capable of recording at high resolutions are now available at low cost and can be used to perform multilevel recording such as four-level recording. For example, if a recording apparatus having a resolution of 1200 dpi (dots per inch) in the main-scan direction is used to record image data having a main-scan resolution of 400 dpi, four-level recording can be implemented by forming one pixel of 400 dpi by three small dots, in which the number (three in this case) of small dots of 1200 dpi is made to correspond to the density value of the input image. Of course, if two-level (binary) recording is performed at 400 dpi, all three of the small dots of 1200 dpi should be made to correspond to black in case of black and to white in case of white.
The trend toward combining copiers and facsimile machines has accelerated in recent years so that now it is required that even a facsimile machine provide high-quality printing in 256 tones or more when used for copying. Accordingly, consider a case where document image data that has been read by the scanner of a facsimile apparatus is transmitted. When two-level image data corresponding to 64 tones, for example, is produced by binarization processing and the data is used to produce a copy, it is desired that image data of 256 tones be generated by m-level conversion processing in order to exploit the recording characteristics (resolution, tonality, etc.) of the printer section to the maximum extent. When such image processing is executed, two-level (binary) error diffusion processing is used widely as the binarizing image processing. As for processing for a conversion to m levels, wide use is made of m-level error diffusion processing in which the binary error diffusion processing is expanded and the output value is converted to m levels. These functions are provided separately in each apparatus in conformity with the purpose of the apparatus.
However, when a two-level (binarizing) processing circuit for converting a read image to two levels in order to transmit the image and a multilevel conversion processing circuit which executes multilevel conversion processing for copying the read image are constructed in the above-mentioned facsimile machine by separate circuits, the result is a facsimile machine that is high in cost.
In a case where image data having multiple tones is printed, there is a method which uses a multilevel printer capable of expressing the grayscale by one dot (pixel), as well as a method which, when a two-level (binary) printer is used, controls the dot size, which is printed by the printer, in dependence upon the value of the multilevel image data to thereby express tones artificially (this is referred to as pulse width modulation, or PWM, below). In the case of the multilevel printer, there is a method of expressing multiple tones by printing while changing ink density, and a method of controlling pixel dot diameter and controlling printed image density depending upon area tone (halftone expressed by changing a ratio of black portion to white portion in a unit area). An example of a multilevel printer using the former method is an ink-jet printer, and an example of a multilevel printer using the latter method is a laser printer.
In case of a binary printer (i.e. a bi-level grayscale printer), there is only one type of ink density possible with an ink-jet printer. If a laser printer of this kind is used, dot diameter of the pixels recorded is fixed. Consequently, in a situation where a binary printer is used, tonality cannot be expressed by one dot alone. Accordingly, use is made of a method (digital PWM or DPWM) in which tonality is expressed artificially by arranging a plurality of dots to correspond to the density of the image data. Since this technique has the advantages of simple printer control and low cost, it is employed in digital copiers and in many multimedia apparatus in which a facsimile function is combined with other functions.
FIGS. 23A and 23B are diagrams useful in describing the principle of such tone expression in case of a multilevel printer and binary printer, respectively.
FIG. 23A is a diagram showing an example of printing by a multilevel printer using area tone, and FIG. 23B is a diagram showing an example of printing by a binary printer. In either case the resolution of input pixels is assumed to be 400 dpi. In the case of the multilevel printer, dot diameter varies depending upon input pixel density, with dot diameter becoming progressively smaller as density decreases (become brighter), as indicated at 1102.about.1105 in FIG. 23A. This is how density is expressed. By contrast, in the example of the binary printer as shown in FIG. 23B, the smallest dots can be printed at a resolution higher than the input pixel resolution. In the example of FIG. 23B, where the input pixel density is 400 dpi, printing can be performed by 1200-dpi dots, which is a three-fold increase. In this case the dots that constitute the 400 -dpi pixel are a maximum of three in number (in case of representation by a single line), and the number of tones that can be expressed is a maximum of four (0.about.3), as indicated at 1112.about.1115.
Assume a scenario in which 256 -tone multilevel image data, in which each pixel is represented by eight bits, is entered and then output to a multilevel printer and to a binary printer. In the case of the multilevel printer, printing can be performed directly in 256 tones because tones can be expressed merely by controlling the printed dot diameter. In order to express 256 tones using the binary printer, on the other hand, it is required that one pixel be expressed by 255 bits in view of the principles described earlier (the method of controlling dot diameter on one line). In case of one pixel at 400 dpi, the size of one dot requires a resolution of 102,000 dpi. In actuality, printer resolution rises far and away the ordinary resolution (1200 dpi and 2400 dpi etc.) and expression of tonality for requesting the printer of high resolution is impossible.
Accordingly, a grayscale conversion by pixel processing is required before printing is performed by digital PWM, especially in the case of a binary printer. Conventionally, the error diffusion method or average density method is used as the method of grayscale conversion. Specifically, a method in practical use involves applying the grayscale conversion to a 256 -tone image each pixel of which is represented by eight bits, creating a four-tone pseudo-halftone image each pixel of which is represented by two bits, and then printing the image data by digital PWM.
Methods of achieving multilevel image recording using such a binary printer include fixed thresholding, dithering, error diffusion of two-tone output, and the average density method, by way of example. All of these methods convert multilevel image data to binary image directly and differ in terms of the relative importance of image quality and processing. However, in order to adapt these methods to make higher definition and higher quality printing possible using a high-resolution printer, it is necessary to perform a resolution conversion by high magnification or to increase reading resolution to conform to the resolution of the recording system. In this case the size of the processing system would be too large and costs would rise, making it difficult to manufacture the product at low cost. For these reasons, products which use the above-mentioned four-level grayscale conversion method and digital PWM have increased in recent years.
FIG. 24 is a diagram useful in describing digital PWM in greater detail. In FIG. 24, 1301, 1302 denote output dot patterns of tones for odd-numbered pixels and even-numbered pixels, respectively. Here the input is a four-tone input, in which 1303, 1304, 1305 and 1306 indicate tone 3 (density 255), tone 2 (density 170), tone 1 (density 85) and tone 0 (density 0). The pixel data enters the digital PWM block in line units and the processing shown in FIG. 24 is executed for each item of pixel data.
The output dot pattern is reversed (by toggle processing) at the odd-numbered (ODD) and even-numbered (EVEN) pixels of the input pixel data. That is, the output pattern always reverses for each item of input pixel data. The purpose of this is to cause dot strings of the output pattern to gather together at mutually adjacent pixels. Whereas the size of one pixel of the input image data corresponds to 400 dpi, the size of a printed dot corresponds to 200 dpi, in the manner illustrated, because two neighboring pixels join together. Adopting this expedient is effective in removing high-frequency components superposed on the image. In particular, it is possible to make false contours, which are produced by four-level error diffusion, less conspicuous.
The above-described digital PWM makes it possible to perform printing, without causing a deterioration in image quality, using a high-resolution binary printer, even if the reading resolution is low. The final product can be manufactured at comparatively low cost. Extremely good effects are obtained when a halftone (photographic) image is printed using a binary printer.
On the other hand, a drawback is that the resolution of characters and line drawings declines, jaggies develop at the contours and straight lines appear disconnected. The reason for this is that in digital PWM processing, the output patterns of the odd- and even-numbered pixels are reversed, neighboring output patterns become connected and black dots or white dots are output in enlarged form.
FIG. 25 is a schematic view for a case in which the toggle processing in digital PWM is turned off so that the same dot pattern is output for both odd- and even-numbered pixels. If toggling is suspended and digital PWM corresponding to 400 dpi is executed, excellent printing can be performed even with regard to characters and line drawings. Now, however, if a character or line drawing includes portions which share a halftone density, there is the danger that false contours and other problems will occur.